package org.rcgwt.client.util;

import com.google.gwt.dom.client.NativeEvent;

public class KeyUtilFirefox extends KeyUtil {

	public static final KeyUtil INSTANCE = new KeyUtilFirefox();

	private KeyUtilFirefox() {
		super();
	}

	/**
	 * Gets the char code from a native JavaScript Event (For FireFox
	 * compatibility)
	 * 
	 * @param e
	 * @return
	 */

	@Override
	public native char getCharCode(NativeEvent e)/*-{
		var code = e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which ? e.which :
		void 0;
		if( e.which ) {
		    if( code && ( code > 31 ) && ( ! ( e.ctrlKey || e.altKey ) ) ){
		        return code;
		    }
		}
		return void 0;
	}-*/;

}
